<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class FamilyHistory extends Model
{
    protected $table = 'st_medical_familyhistory';

    protected $fillable = [
        'record_id',
        'diabetes',
        'hypertension',
        'chd',
        'embolism',
        'hyperlipidemia',
        'tumor',
        'extend',
        'remark',
    ];

    protected $casts = [
        'diabetes'       => 'array',
        'extend'         => 'array',
        'hypertension'   => 'array',
        'chd'            => 'array',
        'embolism'       => 'array',
        'hyperlipidemia' => 'array',
        'tumor'          => 'array',
    ];

    public function medicalRecord()
    {
        return $this->belongsTo(MedicalRecord::class, 'record_id');
    }
}
